package com.zzy.oss.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author kazu
 * @Date 2023/2/4 20:39
 * @Version 1.0
 */
@SuppressWarnings({"all"})
@Component
public class ConstantPropertiesUtils implements InitializingBean {
	
	@Value("${aliyun.oss.file.endpoint}")
	private String endPoint;
	
	@Value("${aliyun.oss.file.accessKeyId}")
	private String accessKeyId;
	
	@Value("${aliyun.oss.file.accessKeySecret}")
	private String accessKeySecret;
	
	@Value("${aliyun.oss.file.bucketName}")
	private String bucketName;
	
	public static String END_POINT;
	
	public static String ACCESS_KEY_ID;
	
	public static String ACCESS_KEY_SECRET;
	
	public static String BUCKET_NAME;
	
	
	@Override
	public void afterPropertiesSet() throws Exception {
		END_POINT = this.endPoint;
		ACCESS_KEY_ID = this.accessKeyId;
		ACCESS_KEY_SECRET = this.accessKeySecret;
		BUCKET_NAME = this.bucketName;
	}
}
